<!--
File    : /animation1.html
Author  : Gray Snail
Version : 1.0
Contact : shtao2011@sina.com
License : Copyright (c) 2021 Gray Snail
Desc    : None
-->
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Animation</title>
    <style type="text/css">
        body {
            width: 100%;
            height: 100%;
            overflow: hidden;
        }
        @keyframes test {
            from {
                transform: translateX(0%);
            }
            to {
                transform: translateX(100%);
            }
        }
        @keyframes test2 {
            0%{ top: 0; left: 0;}
            30%{ top: 50px;}
            68%,72%{ left: 50px;}
            100% {top:100px; left: 100%;}
        }
        .item {
            position: relative;
            height: 10px;
            width: 20px;
            border: 1px solid red;
            animation: test2 2s  ;
        }

        p {
            animation-duration: 5s;
            animation-name: slidein;
            animation-iteration-count: infinite;
            animation-direction: alternate;
        }

        @keyframes slidein {
            from {
                margin-left: 100%;
                width: 300%;
            }
            to {
                margin-left: 0%;
                width: 100%;
            }
        }
    </style>
</head>
<body>

    <div class="item">

    </div>

    <p>字幕</p>
    
</body>
</html>